/**
 * @BelongsProject: gene-mutation-timeyan-host
 * @BelongsPackage: cn.gene.timeyan.pojo.pay.vo
 * @Author: 吕易
 * @CreateTime: 2022-08-10  15:49
 * @Description: TODO
 * @Version: 1.0
 */
package cn.gene.timeyan.pojo.pay.vo;

import lombok.Data;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

@Data
@Accessors(chain = true)
public class PayVO {
    private Integer code; //响应码
    private String message; //响应消息
    private Map<String, Object> data = new HashMap<>();

    public static PayVO ok(){
        PayVO payVO = new PayVO();
        payVO.setCode(0);
        payVO.setMessage("成功");
        return payVO;
    }

    public static PayVO error(){
        PayVO payVO = new PayVO();
        payVO.setCode(-1);
        payVO.setMessage("失败");
        return payVO;
    }

    public PayVO data(String key, Object value){
        this.data.put(key, value);
        return this;
    }
}

